import Vue from 'vue'
import Vuex from 'vuex'

import {
  eduSignInQuery,
  eduSignInDelete,
  eduSignInAdd,
  eduSignInUpdate,
} from '@/api/admin/courseLibrary/eduSignIn.js'

Vue.use(Vuex)

const state = {}

const getters = {}

const actions = {
  async queryeduSignIn({ commit }, listQuery) {
    let res = await eduSignInQuery({ ...listQuery })
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
  async deleteeduSignIn({ commit }, row) {
    let res = await eduSignInDelete(row.id)
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
  async addeduSignIn({ commit }, data) {
    let res = await eduSignInAdd(data)
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
  async updateeduSignIn({ commit }, data) {
    let res = await eduSignInUpdate(data)
    return res.data.code == 0 ? res.data : Promise.reject(new Error('faile'))
  },
}

const mutations = {}

export default {
  state,
  getters,
  actions,
  mutations,
}
